#ifndef _FUNCTIONDEF_H_
#define _FUNCTIONDEF_H_
#include "python3/PythonGrammar30TreeConstants.h"
#include "ast/stmtType.h"
#include "ast/decoratorsType.h"
#include "ast/exprType.h"
#include "ast/argumentsType.h"
#include "ast/NameTok.h"
#include "ast/stmtType.h"
class IVisitor;
class FunctionDef;
typedef QSharedPointer<FunctionDef> FunctionDefPtr;

class FunctionDef: public stmtType
{
public:
    explicit FunctionDef(const NameTokPtr& name, const argumentsTypePtr& args, const StmtTypeList& body, const DecoratorsTypeList& decs, const exprTypePtr& returns, int nodeId=JJTFUNCDEF);
    virtual ~FunctionDef();
    
    
    NameTokPtr name();
    void setName(const NameTokPtr& name);
    
    argumentsTypePtr args();
    void setArgs(const argumentsTypePtr& args);
    
    StmtTypeList body();
    void setBody(const StmtTypeList& body);
    
    DecoratorsTypeList decs();
    void setDecs(const DecoratorsTypeList& decs);
    
    exprTypePtr returns();
    void setReturns(const exprTypePtr& returns);
    
    
    virtual QString type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
    NameTokPtr _name;
    argumentsTypePtr _args;
    StmtTypeList _body;
    DecoratorsTypeList _decs;
    exprTypePtr _returns;
};




#endif